package com.hz.ys_financial.action;


import com.hz.framework.MyAction.BaseAction;
import com.hz.framework.dao.CommonDao;
import com.hz.ys_financial.bean.Takingsorpay;
import com.hz.ys_financial.dao.PlanGatherDao;

/**
 * *****************************************************************************
 *               Copyright(c) 2010 by 哈尔滨华泽数码科技有限公司.
 *                       All rights reserved.
 *******************************************************************************
 *     File Name         :  com.hz.ys_stock.action.StatisticsAction.java
 *     Description(说明)	: 订单预付款信息管理 action
 * -----------------------------------------------------------------------------
 *     No.        Date              Revised by           Description	
 *     			  Jul 29, 2011           韩飞              Created
 *****************************************************************************
 */
public class PlanGatherAction extends BaseAction {

	private static final long serialVersionUID = 1L;
	
	private Object pagList = null;
	private Takingsorpay to = new Takingsorpay();
	
	/**
	 * @author 韩飞
	 * @time Nov 19, 2011	
	 * @return
	 * @throws Exception 
	 * 方法功能:订单预付款信息
	 */
	public String PlanGatherManage() throws Exception {
		boolean selflag = true;
		boolean pagflag = false;
		String rn = "";
		PlanGatherDao pg = new PlanGatherDao();
		String operate = CommonDao.isnull(request.getParameter("operate"));
//		录入页面进入
		if("updpage".equals(operate)){
//			查询人员信息
			request.setAttribute("personlist", pg.SelPerson());
//			查询订单预付款信息
			request.setAttribute("updinfo", pg.SelPlanGatherInfo(request));
			
			rn = "updpage";
			selflag = false;
		}
//		保存信息
		if("updinfo".equals(operate)){
			request.setAttribute("msg", pg.UpdPlanGather(to, "plan"));
			rn = "updpage";
			selflag = false;
		}
//		标记收款
		if("gather".equals(operate)){
			pg.DoSavePlanGather(request);
			rn = "rect";
			selflag = false;
		}
//		默认列表页面
		if(selflag){
			rn = SUCCESS;
			pagList = pg.SelPlanGather(request,"purchase");
			pagflag = true;
		}
//		配置分页
		if(pagflag){
			doAllSearchList(request, "listinfo", pagList, "jdbc");
		}
		
		return rn;
	}
	
	
	public Takingsorpay getTo() {
		return to;
	}
	public void setTo(Takingsorpay to) {
		this.to = to;
	}
}
